package com.sykj.bsc.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropUtil {

	private static Properties properties=null;
	static{
		properties=new Properties();
		InputStream in=PropUtil.class.getClassLoader().getResourceAsStream("pros/ims.properties");
		try {
			properties.load(in);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static String getString(String key){
		String value=properties.getProperty(key);
		return value;
	}
	
	public static int getInt(String key){
		String value=properties.getProperty(key);
		return Integer.valueOf(value);
	}
	
	public static boolean getBoolean(String key,boolean defaultValue){
		String value=properties.getProperty(key);
		if(!Tools.isNotNull(value)){
			return defaultValue;
		}
		return Boolean.valueOf(value);
	}
}
